<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/3/25
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page isELIgnored="false"%>
<html >
<head>
    <title>博客后台-文章类型列表</title>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <link href="${pageContext.request.contextPath}/admin/css/Style.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath}/alert/alert.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="${pageContext.request.contextPath}/admin/js/public.js"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/alert/alert.js"></script>

    <script type="text/javascript">
        /*function addNotice() {
            window.location.href = "${pageContext.request.contextPath}/admin/articletype/add.jsp";
        }*/

      /*  function  addNotice()
        {
            var  typename = prompt( " 请输入类型名称 " , "" ); // 将输入的内容赋给变量 name ，
            // 这里需要注意的是，prompt有两个参数，前面是提示的话，后面是当对话框出来后，在对话框里的默认值
            if (typename) // 如果返回的有内容
            {
                alert( "添加成功 ")
            }
        }*/
        function cannot(){
            alert('<%=request.getParameter("msg")%>');
        }


        function show(){
            document.getElementById('div').style.display="block";
        }

        function hidd(){
            document.getElementById('div').style.display="none";
        }
        function get(){
            var tt = document.form.txt.value;
            if(tt.length>0){
                document.getElementById('div').style.display="none";
            }else{
                alert('不能为空');
                return false;
            }
            return true;
        }


       /* function addNotice() {
          window.open("http://localhost:8088/admin/articletype/add.jsp", 'window', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
        }
*/

    </script>
    <style>
        .shuru{
            text-align: center;
        }
    </style>
</head>
<body>

<jsp:include page="/admin/login/top.jsp"/>
<div class="main">
    <jsp:include page="/admin/login/left.jsp"/>
    <div class="home">
        <br />
<%--<form id="Form1" name="Form1"  method="post">--%>
    <table cellSpacing="1" cellPadding="0" width="100%" align="center"bgColor="#f5fafe" border="0">
        <tbody>
        <tr>
            <td class="ta_01" align="center" bgColor="#f5fafe">
                <strong>文 章 类 别 列 表</strong>
            </td>
        </tr>
        <tr>
            <td class="ta_01" align="right">


                <button type="button" id="add" name="add" value="&#28155;&#21152;" class="button_add"  onclick="show()">
                    &#28155;&#21152;
                </button>
                <div id="div" style="background:#CEADE2;position:absolute;display:none;margin: auto;top:50%;left:50%;margin-top:-50px;margin-left:-250px;width:500px;height:100px;border-radius:5px;">
                    <form name="form" action="${pageContext.request.contextPath}/addArticleType" method="post" ><br>
                        <div class="shuru">
                            <a class="add">请输入添加文章类型：</a><input type="text"  name="typename"/>
                        </div>
                        <input type="hidden" name="typename" value="typename"><br /><br>
                        <div class="shuru">
                            <input type="submit" value="确定" />
                            <input type="button" value="返回" onclick="hidd()"/>
                        </div>
                    </form>
                </div>

            </td>
        </tr>
        <tr>
            <td class="ta_01" align="center" bgColor="#f5fafe">
                <table cellspacing="0" cellpadding="1" rules="all"
                       bordercolor="gray" border="1" id="DataGrid1"
                       style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
                    <tr
                            style="FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #CEADE2">
                        <td align="center" width="12%">类别名称</td>
                        <td align="center" width="8%">创建时间</td>
                        <td width="8%" align="center">编辑</td>
                        <td width="8%" align="center">删除</td>
                    </tr>
                    <c:forEach var="n" items="${listType}" >
                        <tr onmouseover="this.style.backgroundColor = 'white'" onmouseout="this.style.backgroundColor = '#F5FAFE';">
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="18%">${n.typeName}</td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="8%">${n.addtime}</td>
                            <td align="center" style="HEIGHT: 22px" width="7%">
                                <%--<a href="${pageContext.request.contextPath}/updateArticleType?id=${n.n_id}">--%>
                                    <a href="${pageContext.request.contextPath}/admin/articletype/edit.jsp?id=${n.id}">
                                    <img width="16px" src="${pageContext.request.contextPath}/admin/images/i_edit.gif" border="0" style="CURSOR: hand">
                                </a>
                            </td>
                            <td align="center" style="HEIGHT: 22px" width="7%">
                                <a href="${pageContext.request.contextPath}/deleteArticleType?typename=${n.typeName}">
                                    <img src="${pageContext.request.contextPath}/admin/images/i_del.gif" width="16" height="16" border="0" style="CURSOR: hand">
                                </a>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
            </td>
        </tr>
        </TBODY>
    </table>
<%--</form>--%>
    </div>
</div>
</body>
<jsp:include page="/admin/login/bottom.jsp"/>
</html>
